FROM ubuntu:trusty
MAINTAINER blackteay<blackteay@yeah.net>

COPY sources.list /etc/apt

# Install base packages
RUN apt-get update

RUN DEBIAN_FRONTEND=noninteractive apt-get -yq install \
        curl \
        apache2 \
        libapache2-mod-php5 \
        php5-mysql \
        php5-mcrypt \
        php5-gd \
        php5-dev \
        php5-curl \
        php5-common \
        # php5-pdo \
        php-pear \
        php5-pgsql \
        libpq-dev \
        re2c \
        php-apc && \
    rm -rf /var/lib/apt/lists/* && \
    curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
RUN /usr/sbin/php5enmod mcrypt
RUN echo "ServerName localhost" >> /etc/apache2/apache2.conf && \
    sed -i "s/variables_order.*/variables_order = \"EGPCS\"/g" /etc/php5/apache2/php.ini
ENV ALLOW_OVERRIDE **False**

# Add image configuration and scripts
ADD run.sh /run.sh
RUN chmod 755 /*.sh

COPY redis-3.1.1.tgz /home

RUN pecl install home/redis-3.1.1.tgz \
    # && pecl install pdo_pgsql \
    && echo "extension=redis.so" >> /etc/php5/apache2/php.ini
    # && echo "extension=pgsql.so" >> /etc/php5/apache2/php.ini \
    # && echo "extension=pdo_pgsql.so" >> /etc/php5/apache2/php.ini



